build(build-tools): enable exactOptionalPropertyTypes#27568
Open
jason-ha wants to merge 1 commit into
Open
Conversation
Update build-tools packages to use exactOptionalPropertyTypes:true in normal build as well as check exactOptionalPropertyTypes:false successfully type checks (no emit, skipLibCheck). ### Fixes build-tools: - common/biomeConfigUtils.ts — Conditionally spread stopAt only when defined, avoiding passing undefined to the find-up library's Options.stopAt which expects string . - fluidBuild/commonOptions.ts — Changed defaultRoot and root from optional properties ( ?: string ) to required properties with explicit undefined in the union ( string | undefined ), allowing direct assignment from process.env . - fluidBuild/fluidRepo.ts — Removed explicit ignoredDirs: undefined assignment; conditionally spread ignoredDirs only when the mapped value is defined. - fluidBuild/tasks/workers/apiExtractorWorker.ts — Split return into two distinct object literals (success without error , failure with error ) instead of assigning undefined to the optional error property. - fluidBuild/tsCompile.ts — Conditionally spread projectReferences only when commandLine.projectReferences is defined, avoiding passing undefined to TypeScript API's CreateProgramOptions . version-tools: - commands/version.ts — Conditionally spread bumpType only when defined, avoiding undefined assignment to an optional property.
Contributor
Bundle size comparisonBase commit: Notable changesNo bundles changed by ≥ 500 bytes parsed. Per-bundle deltas
|
Contributor
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (106 lines, 18 files), I've queued these reviewers:
How this works
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update build-tools packages to use exactOptionalPropertyTypes:true in normal build as well as check exactOptionalPropertyTypes:false successfully type checks (no emit, skipLibCheck).
Fixes
build-tools:
common/biomeConfigUtils.ts— Conditionally spreadstopAtonly when defined, avoiding passingundefinedto thefind-uplibrary'sOptions.stopAtwhich expectsstring.fluidBuild/commonOptions.ts— ChangeddefaultRootandrootfrom optional properties (?: string) to required properties with explicitundefinedin the union (string | undefined), allowing direct assignment fromprocess.env.fluidBuild/fluidRepo.ts— Removed explicitignoredDirs: undefinedassignment; conditionally spreadignoredDirsonly when the mapped value is defined.fluidBuild/tasks/workers/apiExtractorWorker.ts— Split return into two distinct object literals (success withouterror, failure witherror) instead of assigningundefinedto the optionalerrorproperty.fluidBuild/tsCompile.ts— Conditionally spreadprojectReferencesonly whencommandLine.projectReferencesis defined, avoiding passingundefinedto TypeScript API'sCreateProgramOptions.version-tools:
commands/version.ts— Conditionally spreadbumpTypeonly when defined, avoidingundefinedassignment to an optional property.